<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Cache" content="no-cache">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <title>地址管理</title>
    <script src="javascript/jquery.min.js"></script>
    <script src="javascript/function.js"></script>
    <link rel="stylesheet" href="stylesheet/style_v1.1.css">
</head>
<body>
<div class="header-title">
    <a href="javascript:void(0);" class="fanhui">
        <img src="image/tick.png" alt="">
    </a>
    <p>地址管理</p>
</div>
<div class="con padding-top60 padding-bottom50 padding-lr5" id="addressShow">
</div>
    <a href="forwardPage_addAddress.action" class="btn">添加地址</a>
     <%@ include file="footer.jsp"%>
<script>
$(function () {
	queryAddressList();
});
function queryAddressList() {
	var params = "parms.openId=" + "1";
	$.ajax({
				type : 'post',
				url : 'cliffordAction!queryAddressList.action',
				async : false,
					data : params, // 传给action的参数
				success : function(data) {
					if (data.result == 1) {
						if (data.resultData.size == '0') {
							document.getElementById("addressShow").innerHTML="";
							alert("您还没有添加地址哦~");
						} else {
							var list = data.resultData.datalist;
							var html = "";
							for ( var i = 0; i < list.length; i++) {
								  html += '  <div class="adds-list">';
								  html += '   <p><b>'+list[i].userName+'</b><span>'+list[i].userAddressMobile+'</span></p>';
								  html += '   <p>'+list[i].userAddress+'</p>';
								  html += '   </div>';
							}
							document.getElementById("addressShow").innerHTML = html;
						}
					} else {
						document.getElementById("addressShow").innerHTML="";
						alert(data.msg);
					}
				}
			});
}
</script>
</body>
</html>